/**     
 * @{#} HashArithmetic.java Create on 2011-7-22 上午10:33:50     
 *     
 * Copyright (c) 2011 by xiaofeng.zhouxf     
 */
package com.sefer.memcached.arithmetic;

/**
 * Hash arithmetic for client.
 * 
 * @author <a href="mailto:xiaofeng.zhouxf83@gmail.com">xiaofeng.zhouxf</a>
 * @version 1.0
 */
public interface HashArithmetic {

	/**
	 * Calculate the index for the key to store.
	 * 
	 * @param key
	 *            the key to store
	 * @param totalNodeNumber
	 *            the number of server's node
	 * @return
	 */
	int calculate(Object key, int totalNodeNumber);
}
